import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import '../../../components/people_team.dart';

class NearbyPeople extends StatefulWidget {
  List<Map> listpeople = [
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
    {
      "photo":
          "https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D680%2C800/sign=482fab52bf8f8c54e386cd29021901cd/f7246b600c3387440c8642c05a0fd9f9d62aa0cf.jpg",
      "name": "喜羊羊"
    },
  ];

  @override
  _NearbyPeopleState createState() => _NearbyPeopleState();
}

class _NearbyPeopleState extends State<NearbyPeople> {
  @override
  Widget build(BuildContext context) {
    return Container(
        padding: EdgeInsets.symmetric(
          vertical: 5,
        ),
        child: Column(
          children: [
            Container(
              padding: EdgeInsets.symmetric(horizontal: 10),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    "附近的值得关注的人",
                    style: TextStyle(
                        color: Colors.black,
                        fontWeight: FontWeight.bold,
                        fontSize: 16),
                  ),
                  GestureDetector(
                    onTap: () {
                      print("点击了查看更多");
                    },
                    child: Container(
                      child: Row(
                        children: [
                          Text(
                            "查看更多",
                            style:
                                TextStyle(fontSize: 15, color: Colors.black12),
                          ),
                          Icon(
                            IconData(0xe60e, fontFamily: "alIcons"),
                            size: 15,
                            color: Colors.black12,
                          )
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
            Container(
              margin: EdgeInsets.only(top: 20),
              child: Padding(
                padding: EdgeInsets.only(left: 5, right: 5),
                child: Wrap(
                  spacing: 15,
                  runSpacing: 8,
                  children: widget.listpeople
                      .map((e) =>
                          PeopleTeam(name: e["name"], imgurl: e["photo"]))
                      .toList(),
                ),
              ),
            )
          ],
        ));
  }
}
